<template>
	<view>
		<view class="mine_msg" @click="msg_info">
			<u-icon name="chat" :color="color" size="28"></u-icon>
			<view v-if="read > 0 && read < 100" class="tags">
				{{read}}
			</view>
			<view v-else-if="read > 99" class="tags">
				99+
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		props: {
			color: {
				type: String,
				default: 'fff'
			},
			read: {
				type: Number,
				default: 0
			}
		},
		methods: {
			msg_info() {
				uni.navigateTo({
					url: '/pages/public/message/message_info'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.mine_msg {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		box-sizing: border-box;
		margin: 25rpx;
		position: relative;
		margin-top: 30rpx;
		
		image {
			width: 70rpx;
			height: 70rpx;
		}
	
		.iconfont {
			font-size: 48rpx;
			// width: 100%;
			text-align: end;
		}
		
		.tags {
			padding: 0 10rpx;
			position: absolute;
			font-size: 20rpx;
			background-color: #fa3534;
			color: #ffffff;
			display: flex;
			justify-content: center;
			align-items: center;
			border-radius: 20rpx;
			top: -10rpx;
			right: -10rpx;
		}
	}
</style>